**************************************************************************************************************************************
******** Replication code for Bøttkjær & Justesen "Why do voters support corrupt politicians? Experimental evidence from South Africa"
*** This code replicates the analysis and figures in the JOP paper *******************************************************************
*** Please run the do-file "Do_run_me_first_JOP" before running this replication code ******************************************
**************************************************************************************************************************************

*** Figure 1: Outcome versus treatment group
reg outcome43 i.QR43, r cluster(EA_Numbe)

* Panel 1a: Coefficient plot 
margins r.QR43, 
marginsplot, horizontal unique xline(0, lcolor(black)) yscale(reverse) ylabel(, labsize(small)) recast(scatter) ciopts(lpattern(dash)) /*
*/ xscale(range(-2(0.5)1.5)) xlabel(-2(0.5)1.5, angle(45)) ytitle(Treatment groups (relative to no corruption), tstyle(size(medsmall))) /*
*/ graphregion(fcolor(white)) plotregion(fcolor(white)) title("Panel A. Comparison to no corruption", tstyle(size(medsmall))) /*
*/ xtitle(Coefficient size, tstyle(size(medsmall))) saving(figure1a, replace)

* Panel 1b: Comparing patronage treatment
reg outcome43 ib5.QR43 , r cluster(EA_Numbe)
margins rb5.QR43,  
marginsplot, horizontal unique xline(0, lcolor(black)) yscale(reverse) ylabel(, labsize(small)) recast(scatter) ciopts(lpattern(dash)) /*
*/ xscale(range(-2(0.5)1.5)) xlabel(-2(0.5)1.5, angle(45)) ytitle(Treatment groups (relative to patronage), tstyle(size(medsmall))) /*
*/ graphregion(fcolor(white)) plotregion(fcolor(white)) title("Panel B. Comparison to patronage", tstyle(size(medsmall))) /*
*/ xtitle(Coefficient size, tstyle(size(medsmall))) saving(figure1b, replace)

graph combine figure1a.gph figure1b.gph, title("Figure 1. Voting for corrupt candidates", tstyle(size(medium))) graphregion(fcolor(white)) plotregion(fcolor(white))

graph drop _all

*** Figure 2: Partisanship moderator
*** Support for ANC: ANC partisans: 
reg outcome43 i.QR43##i.anc_partisan, r cluster(EA_Numbe)
margins, dydx(QR43) at(anc_partisan=(0(1)1))
margins, dydx(i(3).QR43) at(anc_partisan=(0(1)1))
 
* Plot: ANC partisanship
marginsplot, recast(scatter) unique ciopts(lpattern(dash)) title(Panel A. Support for corrupt ANC politicians) subtitle(ANC partisans) yscale(range(-3.0 0)) ylabel(-3(0.5)0) /*
*/ xtitle("ANC partisans") xtitle(ANC partisanship, tstyle(size(medsmall))) ytitle(Marginal effect of ANC treatment, tstyle(size(medsmall))) graphregion(fcolor(white)) plotregion(fcolor(white)) saving(anc, replace)

*** Support for DA: DA partisans: 
reg outcome43 i.QR43##i.da_partisan, r cluster(EA_Numbe)
margins, dydx(QR43) at(da_partisan=(0(1)1))
margins, dydx(i(4).QR43) at(da_partisan=(0(1)1))
 
* Plot: Support for DA: DA partisans partisanship
marginsplot, recast(scatter) unique ciopts(lpattern(dash)) title(Panel B. Support for corrupt DA politicians) subtitle(DA partisans) yscale(range(-3.0 0)) ylabel(-3(0.5)0)  /*
*/ xtitle("DA partisans") xtitle(DA partisanship, tstyle(size(medsmall))) ytitle(Marginal effect of DA treatment, tstyle(size(medmedsmall))) graphregion(fcolor(white)) plotregion(fcolor(white)) saving(da, replace)

graph combine anc.gph da.gph, title("Figure 2. Partisanship and support for corrupt candidates", tstyle(size(medium))) graphregion(fcolor(white)) plotregion(fcolor(white)) 

graph drop _all

***** Figure 3: Patronage and corruption voting

* Does LSM conditition responses?
reg outcome43 i.QR43##c.LSM14_0, r cluster(EA_Numbe)
margins, dydx(QR43) at(LSM14_0=(0(1)12)) 
margins, dydx(i(5).QR43) at(LSM14_0=(0(1)12)) 

* Patronage treatment conditional on living standard
marginsplot, recastci(rline) recast(line) ciopts(lpattern(dash)) yline(0, lcolor(black)) yscale(range(-2.5 1)) ylabel(-2(0.5)1, angle(45))/*
*/ graphregion(fcolor(white)) plotregion(fcolor(white)) title("Panel A. Conditioning effect of living standards", tstyle(size(medsmall))) /*
*/ ytitle(Marginal effect of patronage, tstyle(size(medsmall))) xtitle(Living standard, tstyle(size(medsmall))) /*
*/ note("High/low values indicate high/low living standard", tstyle(size(medsmall))) saving(patronage_lsm, replace)

* Does poverty conditition responses?
reg outcome43 i.QR43##c.poverty100, r cluster(EA_Numbe)
margins, dydx(QR43) at(poverty100=(0(10)100)) 
margins, dydx(i(5).QR43) at(poverty100=(0(10)100)) 

* Plot: Patronage treatment conditional on poverty
marginsplot, recastci(rline) recast(line) ciopts(lpattern(dash)) yline(0, lcolor(black)) yscale(range(-2.5 1)) ylabel(-2(0.5)1, angle(45))/*
*/ graphregion(fcolor(white)) plotregion(fcolor(white)) title("Panel B. Conditioning effect of poverty", tstyle(size(medsmall))) /*
*/ ytitle(Marginal effect of patronage, tstyle(size(medsmall))) xtitle(Poverty, tstyle(size(medsmall))) /*
*/ note("High/low values indicate high/low poverty", tstyle(size(medsmall))) saving(patronage_poverty, replace)

* Does education conditition responses?
reg outcome43 i.QR43##c.edu, r cluster(EA_Numbe)
margins, dydx(QR43) at(edu=(0(1)8)) 
margins, dydx(i(5).QR43) at(edu=(0(1)8)) 

* Plot: Patronage treatment conditional on education
marginsplot, recastci(rline) recast(line) ciopts(lpattern(dash)) yline(0, lcolor(black)) yscale(range(-2.5 1)) ylabel(-2(0.5)1, angle(45))/*
*/ graphregion(fcolor(white)) plotregion(fcolor(white)) title("Panel C. Conditioning effect of education", tstyle(size(medsmall))) /*
*/ ytitle(Marginal effect of patronage, tstyle(size(medsmall))) xtitle(Education, tstyle(size(medsmall))) /*
*/ note("High/low values indicate high/low education", tstyle(size(medsmall))) saving(patronage_edu, replace)

* Does unemployment conditition responses?
reg outcome43 i.QR43##c.unemp, r cluster(EA_Numbe)
margins, dydx(QR43) at(unemp=(0(1)1)) 
margins, dydx(i(5).QR43) at(unemp=(0(1)1)) 

* Plot: Patronage treatment conditional on unemployment
marginsplot, recastci(rline) recast(line) ciopts(lpattern(dash)) yline(0, lcolor(black)) yscale(range(-2.5 1)) ylabel(-2(0.5)1, angle(45))/*
*/ graphregion(fcolor(white)) plotregion(fcolor(white)) title("Panel D. Conditioning effect of unemployment", tstyle(size(medsmall))) /*
*/ ytitle(Marginal effect of patronage, tstyle(size(medsmall))) xtitle(Unemployment, tstyle(size(medsmall))) /*
*/ note(1=Unemployed, tstyle(size(medsmall))) saving(patronage_unemp, replace)

graph combine patronage_lsm.gph patronage_poverty.gph patronage_edu.gph patronage_unemp.gph, title("Figure 3. Patronage and corruption voting", tstyle(size(medium))) graphregion(fcolor(white)) plotregion(fcolor(white)) 

graph drop _all


***** End **** 

